<!DOCTYPE html>
<!--
Copyright 2016 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel="import" href="/tracing/core/test_utils.html">

<link rel="import" href="testing_common.html">

<script>
'use strict';

tr.b.unittest.testSuite(function() {
  test('sortQueryPart sorts query string', function() {
    const query = 'c=1&b=2&a=3';
    assert.strictEqual('a=3&b=2&c=1',
        testing_common.sortQueryPart(query));
  });

  test('sortQueryPart sorts query string with path', function() {
    const query = 'path?c=1&b=2&a=3';
    assert.strictEqual('path?a=3&b=2&c=1',
        testing_common.sortQueryPart(query));
  });

  test('sortQueryPart does not support repeated keys', function() {
    const query = 'path?a=1&a=3&a=2';
    assert.strictEqual('path?a=2',
        testing_common.sortQueryPart(query));
  });
});
</script>
